package CaseTraining;

public class CaseDemo07_2 {
    public static void main(String[] args) {
        System.out.println("当前素数个数为" + search(101, 200) + "个");
    }
    public static int search(int start, int end){
        int count = 0;
        OUT:  //外部循环标签
        //for循环区间内所有的数
        for (int i = start; i <= end; i++) {

            //for循环让所有的数除以从2开始到自身的一半取余
            for (int j = 2; j <= i/2 ; j++) {
                if(i % j ==0){
                    //不是素数
                    continue OUT;
                }
            }

                System.out.println(i);
                count ++;

        }
        return count;
    }
}
